package com.company.beauty.ids.handler;

/**
 * <p>snowflake handler</p >
 *
 * @author youyoukele
 * @version 1.0
 * @date 2024/1/4 10:58
 */
public interface SnowflakeHandler {

    /**
     * 权重，若有多个实现，优先获取高权重的实现
     *
     * @return
     */
    default int weight() {
        return 0;
    }

    /**
     * 获取终端ID
     *
     * @return
     */
    int getWorkerId();

    /**
     * 获取集群ID
     *
     * @return
     */
    int getCenterId();

}
